home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form frmMain
- Caption = "Crescent Internet ToolPak UUEncode/UUDecode OLE Control"
- ClientHeight = 2880
- ClientLeft = 1155
- ClientTop = 2235
- ClientWidth = 7065
- Height = 3285
- Left = 1095
- LinkTopic = "Form1"
- ScaleHeight = 2880
- ScaleWidth = 7065
- Top = 1890
- Width = 7185
- Begin VB.CommandButton cmdQuit
- Caption = "Quit"
- Height = 375
- Left = 5760
- TabIndex = 6
- Top = 600
- Width = 1095
- End
- Begin VB.Frame fraStatus
- Height = 135
- Left = 240
- TabIndex = 3
- Top = 1080
- Width = 6615
- End
- Begin VB.CommandButton cmdDecode
- Caption = "Decode A File"
- Height = 375
- Left = 240
- TabIndex = 2
- Top = 600
- Width = 2295
- End
- Begin VB.CommandButton cmdEncode
- Caption = "Encode A File"
- Height = 375
- Left = 240
- TabIndex = 1
- Top = 120
- Width = 2295
- End
- Begin VB.Label lblDFSize
- Alignment = 1 'Right Justify
- Caption = "Destination File Size:"
- Height = 255
- Left = 240
- TabIndex = 12
- Top = 2520
- Width = 1575
- End
- Begin VB.Label lblDFName
- Alignment = 1 'Right Justify
- Caption = "Destination Filename:"
- Height = 255
- Left = 240
- TabIndex = 11
- Top = 2160
- Width = 1575
- End
- Begin VB.Label lblSFSize
- Alignment = 1 'Right Justify
- Caption = "Source File Size:"
- Height = 255
- Left = 240
- TabIndex = 10
- Top = 1800
- Width = 1575
- End
- Begin VB.Label lblSFName
- Alignment = 1 'Right Justify
- Caption = "Source Filename:"
- Height = 255
- Left = 240
- TabIndex = 9
- Top = 1440
- Width = 1575
- End
- Begin VB.Label lblDestinationFilesize
- Alignment = 1 'Right Justify
- BorderStyle = 1 'Fixed Single
- Height = 255
- Left = 1920
- TabIndex = 8
- Top = 2520
- Width = 2055
- End
- Begin VB.Label lblSourceFilesize
- Alignment = 1 'Right Justify
- BorderStyle = 1 'Fixed Single
- Height = 255
- Left = 1920
- TabIndex = 7
- Top = 1800
- Width = 2055
- End
- Begin VB.Label lblDestinationFilename
- BorderStyle = 1 'Fixed Single
- Height = 255
- Left = 1920
- TabIndex = 5
- Top = 2160
- Width = 3855
- End
- Begin VB.Label lblSourceFilename
- BorderStyle = 1 'Fixed Single
- Height = 255
- Left = 1920
- TabIndex = 4
- Top = 1440
- Width = 3855
- End
- Begin ComctlLib.ProgressBar prgEncode
- Height = 375
- Left = 240
- TabIndex = 0
- Top = 2880
- Width = 5535
- _Version = 65536
- _ExtentX = 9763
- _ExtentY = 661
- _StockProps = 192
- Appearance = 1
- BorderStyle = 1
- End
- Begin CIUULib.CIUU CIUU1
- Height = 450
- Left = 6240
- Top = 1440
- Width = 480
- _Version = 65536
- _ExtentX = 847
- _ExtentY = 794
- _StockProps = 0
- SourceFilename = ""
- DestinationFilename= ""
- End
- Attribute VB_Name = "frmMain"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Private Sub CIUU1_Decoded(ByVal BytesRead As Long, ByVal BytesWritten As Long, ByVal LinesDecoded As Long)
- ' update progress with total bytes read
- ' throughout the decode phase
- prgEncode.Value = BytesRead
- End Sub
- Private Sub CIUU1_DecodingFinished(ByVal Error As Integer)
- ' display the actual destination
- ' file size
- lblDestinationFilesize.Caption = Format(CIUU1.DestinationFileSize, _
- "###,###,###")
- ' display the source file name you
- ' just decoded
- MsgBox ("Finished decoding " & CIUU1.SourceFilename)
- ' enable all buttons
- cmdDecode.Enabled = True
- cmdEncode.Enabled = True
- cmdQuit.Enabled = True
- End Sub
- Private Sub CIUU1_DecodingStarted()
- ' disable all buttons
- ' because we are busy
- cmdDecode.Enabled = False
- cmdEncode.Enabled = False
- cmdQuit.Enabled = False
- ' intialize the progress bar
- ' maximum
- prgEncode.Max = CIUU1.SourceFileSize
- ' expand form so we can see
- ' the progress bar
- frmMain.Height = 3795
- ' display source and destination
- ' file name
- lblSourceFilename.Caption = CIUU1.SourceFilename
- lblDestinationFilename.Caption = CIUU1.DestinationFilename
- ' display the actual source
- ' file size
- lblSourceFilesize.Caption = Format(CIUU1.SourceFileSize, _
- "###,###,###")
- ' calculate the approximate destination
- ' file size based on the source file size
- nDestinationFilesize& = CIUU1.SourceFileSize - (CIUU1.SourceFileSize * 0.291)
- lblDestinationFilesize.Caption = "approximately " & Format(Str$(LTrim$(nDestinationFilesize&)), _
- "###,###,###")
- End Sub
- Private Sub CIUU1_Encoded(ByVal BytesRead As Long, ByVal BytesWritten As Long, ByVal LinesEncoded As Long)
- ' update progress with total bytes read
- ' throughout the encode phase
- prgEncode.Value = BytesRead
- End Sub
- Private Sub CIUU1_EncodingFinished(ByVal Error As Integer)
- ' display the actual destination
- ' file size
- lblDestinationFilesize.Caption = Format(CIUU1.DestinationFileSize, _
- "###,###,###")
- ' display the source file name you
- ' just decoded
- MsgBox ("Finished encoding " & CIUU1.SourceFilename)
- ' enable all buttons
- cmdDecode.Enabled = True
- cmdEncode.Enabled = True
- cmdQuit.Enabled = True
- End Sub
- Private Sub CIUU1_EncodingStarted()
- ' disable all buttons
- ' because we are busy
- cmdDecode.Enabled = False
- cmdEncode.Enabled = False
- cmdQuit.Enabled = False
- ' intialize the progress bar
- ' maximum
- prgEncode.Max = CIUU1.SourceFileSize
- ' expand form so we can see
- ' the progress bar
- frmMain.Height = 3795
- ' display source and destination
- ' file name
- lblSourceFilename.Caption = CIUU1.SourceFilename
- lblDestinationFilename.Caption = CIUU1.DestinationFilename
- ' display the actual source
- ' file size
- lblSourceFilesize.Caption = Format(CIUU1.SourceFileSize, _
- "###,###,###")
- ' calculate the approximate destination
- ' file size based on the source file size
- nDestinationFilesize& = CIUU1.SourceFileSize + (CIUU1.SourceFileSize * 0.4009)
- lblDestinationFilesize.Caption = "approximately " & Format(Str$(LTrim$(nDestinationFilesize&)), _
- "###,###,###")
- End Sub
- Private Sub cmdDecode_Click()
- ' decode a specified file if a file has not been
- ' specified, dialog boxes will prompt you for a
- ' source and destination file
- ' UUDecode initiates the decoding operation
- ' which causes the DecodingStarted event to
- ' fire. When the decoding operation completes,
- ' the DecodingFinished event fires. If you set
- ' the FireStatus property to True, the Decoded
- ' event fires during the decoding operation
- ' (depending on the file size).
- CIUU1.UUDecode
- End Sub
- Private Sub cmdEncode_Click()
- ' encode a specified file if a file has not been
- ' specified, dialog boxes will prompt you for a
- ' source and destination file
- ' UUEncode initiates the encoding operation
- ' which causes the EncodingStarted event to
- ' fire. When the encoding operation completes,
- ' the EncodingFinished event fires. If you set
- ' the FireStatus property to True, the Encoded
- ' event fires during the decoding operation
- ' (depending on the file size).
- CIUU1.UUEncode
- End Sub
- Private Sub cmdQuit_Click()
- ' end the application
- End
- End Sub
- Private Sub Form_Load()
- ' -------------------------------------------------------------------
- ' Title: UUEncode
- ' Description: Demonstrates the Crescent CIUU ActiveX Component allowing
- ' user selectable file encoding/decoding of any size
- ' file.
- ' Author: Stephen Casella
- ' Last Revision: May 2, 1996
- ' -------------------------------------------------------------------
- ' center main form
- frmMain.Top = Screen.Height \ 2 - frmMain.Height \ 2
- frmMain.Left = Screen.Width \ 2 - frmMain.Width \ 2
- ' explicitly show the form
- frmMain.Show
- ' initialize the progress
- ' bar minimum
- prgEncode.Min = 0
- End Sub
-